home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / spawno30.zip / SPAWNLE.C < prev    next >
C/C++ Source or Header  |  1990-09-15  |  999b  |  29 lines

  1. /********************************************************************/
  2. /*   SPAWNO v2.0      XMS/disk swapping replacement for spawn...()  */
  3. /*   (c) Copyright 1990 Ralf Brown  All Rights Reserved         */
  4. /*                                    */
  5. /*   May be freely copied provided that this copyright notice is    */
  6. /*   not altered or removed.                        */
  7. /********************************************************************/
  8.  
  9. #include "spawno.h"
  10. #include <alloc.h>
  11.  
  12. extern char *__spawn_env ;
  13. int pascal __spawn_buildenv(const char **) ;
  14.  
  15. int _Cdecl spawnleo(const char *overlay_path,const char *prog_name,...)
  16. {
  17.    int retval ;
  18.    void *env ;
  19.  
  20.    va_start(env,1) ;
  21.    while (*((char *)env))  /* find NULL terminating list of program args */
  22.       va_arg(env,void*) ;
  23.    va_arg(env,void*) ;       /* point at pointer to list of env variables */
  24.    retval = __spawnv(overlay_path,prog_name,_va_ptr,__spawn_buildenv(*(char ***)env)) ;
  25.    va_end(env) ;
  26.    free(__spawn_env) ;
  27.    return retval ;
  28. }
  29.